package cyou.breathe.blog.knowledgebase.infrastructure.config;

import cyou.breathe.blog.api.article.service.ArticleFacadeService;
import cyou.breathe.blog.api.folder.service.FolderFacadeService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author: breathe
 * @createTime: 2025-09-05
 */
@Configuration
public class KnowledgeBaseDubboConfiguration {

    @DubboReference(version = "1.0.0")
    private FolderFacadeService folderFacadeService;

    @Bean
    @ConditionalOnMissingBean(name = "folderFacadeService")
    public FolderFacadeService folderFacadeService() {
        return folderFacadeService;
    }

    @DubboReference(version = "1.0.0")
    private ArticleFacadeService articleFacadeService;

    @Bean
    @ConditionalOnMissingBean(name = "articleFacadeService")
    public ArticleFacadeService articleFacadeService() {
        return articleFacadeService;
    }

}
